package com.axend.aerosense.room.entity;

import android.text.TextUtils;

import com.axend.aerosense.base.bean.BaseDevInfoBean;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class WardInfoBean extends BaseDevInfoBean {
    private String wardUuid;
    private String wardName;
    private String wardPhone;
    //受监护人电话区号 传区号数字即可 如：+1 传1
    private String wardPhoneAreaCode = "1";
    //性别 （Not Now）、Male、Female 性别类型 0未设定 1男 2女
    private int wardSexType;
    //生日 格式：1997-02-26
    private String wardBirthday;
    //身高 格式：6-5  {6（左）为ft， 5（右）为in}  兼容以前的数据，现在单位是cm
    private String wardHeight;
    //体重 kg
    private int wardWeight;
    private String wardImg;


    public String getHeight(){
        String height = "";
        if(!TextUtils.isEmpty(wardHeight)){
            if (wardHeight.contains("-")) {
                String[] arr = wardHeight.split("-");
                height = arr[0];
            } else {
                height = wardHeight;
            }
            height += " cm";

//            int foot = 0, inch = 0;
//            try{
//                String[] arr = wardHeight.split("-");
//                foot = Integer.parseInt(arr[0]);
//                inch = Integer.parseInt(arr[1]);
//
//            }catch (Exception e){
//                e.printStackTrace();
//            }
//            height = new Height(foot, inch);
        }

        return height;

    }

}
